package com.deng.spring.myapp;

import com.deng.spring.myapp.service.IOrderService;
import com.deng.spring.myapp.service.imp.OrderServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Lazy;

/**
 * @author 邓力宾
 * @date 2020/7/1 15:27
 * @desc 配置类 不加@Configuration注解 在 OrderSelector中配置
 */
public class OrderConfig {

	public OrderConfig(){
		System.out.println("OrderConfig Construct Method");
	}
	@Lazy
	@Bean(name = "orderService", initMethod = "init") // 可以指定名称，不指定默认是方法名
	public IOrderService orderService(){
		return new OrderServiceImpl();
	}
}
